//
//  JMBrowserCollectionCell.m
//  JMPhotoWeb
//
//  Created by JM Zhao on 2017/9/6.
//  Copyright © 2017年 JunMing. All rights reserved.
//

#import "JMBrowserCollectionCell.h"
#import "JMBrowserModel.h"
#import "JMBrowserImage.h"
#import "UIImageView+WebCache.h"

@interface JMBrowserCollectionCell()
@property (nonatomic, strong) JMBrowserImage *leftBtn;
@end

@implementation JMBrowserCollectionCell
- (instancetype)initWithFrame:(CGRect)frame
{
    if ([super initWithFrame:frame]) {
        
        self.backgroundColor = [UIColor whiteColor];
        
        _leftBtn = [[JMBrowserImage alloc] initWithFrame:CGRectZero];
        _leftBtn.contentMode = UIViewContentModeScaleAspectFit;
        [self.contentView addSubview:_leftBtn];
    }
    
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    _leftBtn.frame = self.bounds;
}

- (void)setModel:(JMBrowserModel *)model
{
    _model = model;
    _leftBtn.image = [UIImage imageWithContentsOfFile:model.imagePath];
//    [_leftBtn sd_setImageWithURL:[NSURL URLWithString:model.imagePath]];
}

@end
